IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : EntityQueryPager<T> Class |
'Declaration
Public Class EntityQueryPager(Of T) Inherits EntityQueryPager
'Usage
Dim instance As EntityQueryPager(Of T)
public class EntityQueryPager<T> : EntityQueryPager
The QueryStrategy of the baseQuery controls whether paging is managed over just the local cache (QueryStrategy.CacheOnly), just the database (QueryStrategy.DataSourceOnly), or both ( QueryStrategy.DataSourceThenCache). Merge semantics are determined by the baseQuery.QueryStrategy.MergeStrategy.
No query is executed until the first MoveTo method is called. You'll usually call MoveToFirstPage or MoveToFirstPageAsync to get things started. You can then move forward and backward through query results using the MoveToNextPage and MoveToPreviousPage methods or their asynchronous counterparts. As paging is performed a query is executed for the specific "page" of the overall query results using the appropriate "skip" and "take" LINQ operators. MoveToLastPage allows you to go directly to the final page of results. The PageIndex and CurrentPageResults are used to indicate the current page and its data. When using the asynchronous API, query results are also returned in the EntityQueryPager.PageChangedOperation<T,T2>.
The PageChanging and PageChanged events are fired for all syncrhonous and asynchronous "MoveTo" calls.
An IdeaBlade.Core.ISortSelector is required to provide for ordered, and orderly, paging. Ideally the sort selector should guarantee that no two records have the same sort position, however the pager will still work with 'nonunique' sorts but performance will be improved the more unique the sort.
If the baseQuery's EntityManager is cleared then this will trigger a Reset call within this instance.
System.Object
IdeaBlade.EntityModel.EntityQueryPager
IdeaBlade.EntityModel.EntityQueryPager<T>
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2